package test;

import org.dreamwork.jasmine2.sample.converter.Class1;

import java.lang.reflect.Method;

/**
* Created by IntelliJ IDEA.
* User: seth.yang
* Date: 2014/12/12
* Time: 23:09
*/
public class Target {
    public void test () throws TestException {
        throw new TestException ();
    }

    public void test2 () {
        try {
            throw new TestException ();
        } catch (Exception ex) {
            throw new RuntimeException (ex);
        }
    }

    public void test3 () {
        String name = getClass ().getCanonicalName ();
        try {
            Class<?> c = Class.forName (name);
            Method m = c.getDeclaredMethod ("test2");
            m.invoke (new Target ());
        } catch (Exception ex) {
            throw new RuntimeException (ex);
        }
    }

    public void test4 () throws MyException {
        throw new MyException ();
    }

    public void test5 () throws TestException {
        test ();
    }
}
